/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package utils;

/**
 *
 * @author Administrator
 */
public class Point {
private Integer x;
	private Integer y;
	
	public Point(Point p)
	{
		x = p.getX();
		y = p.getY();
	}
	
	public Point(Integer x, Integer y) {
		super();
		this.x = x;
		this.y = y;
	}
	public Integer getX() {
		return x;
	}
	public void setX(Integer x) {
		this.x = x;
	}
	public Integer getY() {
		return y;
	}
	public void setY(Integer y) {
		this.y = y;
	}
	
	public void Move(Integer VX, Integer VY)
	{
		x = x- VX;
		y = y - VY;
	}
	
	public void MoveByVector(Integer vx, Integer vy)
	{
		x = x + vx;
		y = y + vy;
	}

	public void MoveTo(Integer x_, Integer y_)
	{
		x = x_;
		y = y_;
		
	}
	
	public Point Move(Point Begin, Integer odl, double alfa)
	{

		
		
		Double x =  odl.doubleValue();
		Double y = 0.0;
		Double xPoObrocie = x*java.lang.Math.cos(alfa) - y*java.lang.Math.sin(alfa);
		Double yPoObrocie = x*java.lang.Math.sin(alfa) + y*java.lang.Math.cos(alfa);
		
		x = xPoObrocie + Begin.getX();
		y = yPoObrocie + Begin.getY();
		Point tempP = new Point(x.intValue(), y.intValue());
		return tempP;
	}
}
